</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
  <h2 class="u-tt">{$action_name}表单</h2>
  <ul id="tabs">
    <li> <a class="z-crt" href="#tab1"><span class="icon">&#xf05a;</span> 基本信息</a></li>
	<li><a href="<?php echo url("admin_category/index"); ?>"><span class="icon">&#xf101;</span> 表单列表</a></li>
  </ul>
</div>
<div class="f-sep10"></div>
<div class="m-form">
  <form action="<?php echo url('admin_category/'.$action.'_save'); ?>" method="post" id="form">
    <fieldset>
      <div class="formitm">
        <label class="lab" >表单名称：</label>
        <div class="ipt">
          <input name="name" type="text" class="u-ipt" id="name" value="{$info.name}" datatype="s1-20" errormsg="表单名称至少1~20个字符！" />
          <span class="Validform_checktip"></span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >表单表名：</label>
        <div class="ipt">
          <input name="table" type="text" class="u-ipt" id="table" value="{$info.table}" datatype="/^\w+$/" errormsg="表单表名只能为英文和下划线！" />
          <span class="Validform_checktip"></span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >内容排序：</label>
        <div class="ipt">
		  <input name="order" type="text" class="u-ipt" id="order" value="{$info.order isset="id desc"}" datatype="*"  errormsg="内容排序不能为空！" />
          <span class="Validform_checktip">针对前后台列表的分页排序</span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >前台访问：</label>
        <div class="ipt">
		<div class="txt">
          <?php if(!isset($info['display'])){ $info['display']=1; } ?>
        <input name="display" type="radio" value="1" <!--if:{$info['display']==1}--> checked="checked" <!--{/if}--> />
        是
        &nbsp;&nbsp;
        <input name="display" type="radio" value="0" <!--if:{$info['display']==0}--> checked="checked" <!--{/if}--> />
        否
		</div>
          <span class="Validform_checktip">关闭后前台将不能查看列表分页内容</span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >前台发布：</label>
        <div class="ipt">
		<div class="txt">
          <?php if(!isset($info['release'])){ $info['release']=1; } ?>
        <input name="release" type="radio" value="1" <!--if:{$info['release']==1}--> checked="checked" <!--{/if}--> />
        是
        &nbsp;&nbsp;
        <input name="release" type="radio" value="0" <!--if:{$info['release']==0}--> checked="checked" <!--{/if}--> />
        否
		</div>
          <span class="Validform_checktip">关闭后将不能从前台提交表单</span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >前台发布验证码：</label>
        <div class="ipt">
		<div class="txt">
          <?php if(!isset($info['verify'])){ $info['verify']=1; } ?>
        <input name="verify" type="radio" value="1" <!--if:{$info['verify']==1}--> checked="checked" <!--{/if}--> />
        开启
        &nbsp;&nbsp;
        <input name="verify" type="radio" value="0" <!--if:{$info['verify']==0}--> checked="checked" <!--{/if}--> />
        关闭
		</div>
          <span class="Validform_checktip">开启后必须输入验证码才可以提交</span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >前台分页数：</label>
        <div class="ipt">
		  <input name="page" type="text" class="u-ipt" id="page" value="{$info.page isset="10"}" reg="n" errormsg="分页数只能为数字" />
          <span class="Validform_checktip">前台列表的分页数</span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >提交成功后消息：</label>
        <div class="ipt">
          <input name="return_msg" type="text" class="u-ipt" id="return_msg" value="{$info.return_msg isset="表单提交成功"}" datatype="*" errormsg="提交成功消息不能为空" />
          <span class="Validform_checktip"></span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >成功后返回地址：</label>
        <div class="ipt">
		  <input name="return_url" type="text" class="u-ipt" id="return_url" value="{$info.return_url isset=""}"  />
          <span class="Validform_checktip">不填将返回表单列表页</span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >前台列表条件：</label>
        <div class="ipt">
		  <input name="where" type="text" class="u-ipt" id="where" value="{$info.where}" />
          <span class="Validform_checktip">标准DQL条件</span> </div>
      </div>
	  <div class="formitm">
        <label class="lab" >前台模板：</label>
        <div class="ipt">
			<input name="tpl" type="text" class="u-ipt" id="tpl" value="{$info.tpl}" />
          <span class="Validform_checktip">前台表单列表所使用的模板</span> </div>
      </div>
	  
      <div class="formitm formitm-1">
        <button class="u-btn" id="submit" type="submit">保存修改</button>
        <button class="u-btn u-btn-c4" id="reset" type="button">重置</button>
        <span id="tip" class="load"></span> </div>
    </fieldset>
    <input name="id" type="hidden" value="{$info.id}" />
  </form>
</div>
</body>
<script>
Do.ready('base','form','tip', function() {
	saveform('<?php echo url("admin_category/index"); ?>');
	//模板赋值
	function tpl_val(id,val){
		$('#'+id).val(val);
		$.powerFloat.hide();
	}
	function tpl_list(id){
		var list = [ 
		<!--foreach:{$tpl_list $vo}-->
		{
			href: "javascript:tpl_val('"+id+"','{$vo}');",
			text: "{$vo}"
		},
		<!--{/foreach}-->
		{
			text: "请选择使用模板"
		}];
		return list;
	}
	function tpl_power(id){
		$("#"+id).powerFloat({
			width: 308,
			eventType: "click",
			edgeAdjust:false,
			reverseSharp:true,
			target:tpl_list(id),
			targetMode: "list"
		});
	}
	tpl_power("tpl");
});
</script>